// 测试
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var option;
option = {
	xAxis: {
		type: 'category',
		data: []
	},
	yAxis: {
		type: 'value'
	},
	series: [{
		data: [],
		type: 'line'
	}]
};
option && myChart.setOption(option);
// myChart.showLoading(); // 加载动画
var cname = [];
var score = [];
$.ajax({
	url: "http://localhost:8080/springend-sys/getAllTeaStuScore",
	type: "post",
	data: {
		tid: sessionStorage.getItem("tid")
	},
	async:false,
	dataType: "json",
	success: function(result) {
		// console.log(result);
		if (result.status == 0) {
			$.each(result.data, function(index, item) {
				cname.push(item.cname);
				score.push(item.score);
			})
			myChart.setOption({
				xAxis: {
					data: cname
				},
				series: [{
					data: score
				}]
			})
		}
	}
})
